import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '类型：1-普通职位，2-灵活用工，3-共享用工',
    align: "center",
    dataIndex: 'positionType_dictText'
  },
  {
    title: '是否兼职：1-兼职，0-全职',
    align: "center",
    dataIndex: 'ifParttime_dictText'
  },
  {
    title: '公司ID',
    align: "center",
    dataIndex: 'companyId'
  },
  {
    title: '名称ID',
    align: "center",
    dataIndex: 'postId'
  },
  {
    title: '职位名称',
    align: "center",
    dataIndex: 'postName'
  },
  {
    title: '职位描述',
    align: "center",
    dataIndex: 'descr'
  },
  {
    title: '地址名称',
    align: "center",
    dataIndex: 'addressName'
  },
  {
    title: '门牌号',
    align: "center",
    dataIndex: 'addressHouse'
  },
  {
    title: '工作地点',
    align: "center",
    dataIndex: 'address'
  },
  {
    title: '地点经度',
    align: "center",
    dataIndex: 'longitude'
  },
  {
    title: '地点纬度',
    align: "center",
    dataIndex: 'latitude'
  },
  {
    title: '经验要求',
    align: "center",
    dataIndex: 'expRequire'
  },
  {
    title: '最低学历',
    align: "center",
    dataIndex: 'minEducation_dictText'
  },
  {
    title: '薪资范围',
    align: "center",
    dataIndex: 'salaryLow'
  },
  {
    title: '薪资范围',
    align: "center",
    dataIndex: 'salaryUp'
  },
  {
    title: '薪资月份',
    align: "center",
    dataIndex: 'salaryMonth'
  },
  {
    title: '薪资范围',
    align: "center",
    dataIndex: 'salary'
  },
  {
    title: '薪资单位，兼职，元/时，元/天，元/周，元/月',
    align: "center",
    dataIndex: 'unit'
  },
  {
    title: '兼职，薪资单价',
    align: "center",
    dataIndex: 'unitMoney'
  },
  {
    title: '奖金绩效',
    align: "center",
    dataIndex: 'bonus'
  },
  {
    title: '结算方式，兼职，日结、周结、月结、完工结',
    align: "center",
    dataIndex: 'settlementType'
  },
  {
    title: '招聘人数',
    align: "center",
    dataIndex: 'recruitsNumber'
  },
  {
    title: '兼职工作日',
    align: "center",
    dataIndex: 'partDate'
  },
  {
    title: '兼职时间',
    align: "center",
    dataIndex: 'partTime'
  },
  {
    title: '联系电话',
    align: "center",
    dataIndex: 'phone'
  },
  {
    title: '技能要求',
    align: "center",
    dataIndex: 'skill'
  },
  {
    title: '开始日期',
    align: "center",
    dataIndex: 'startDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '结束日期',
    align: "center",
    dataIndex: 'endDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '工作天数',
    align: "center",
    dataIndex: 'workDays'
  },
  {
    title: '共享人数',
    align: "center",
    dataIndex: 'shareNumber'
  },
  {
    title: '分享佣金',
    align: "center",
    dataIndex: 'shareMoney'
  },
  {
    title: '浏览数量',
    align: "center",
    dataIndex: 'browseNumber'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'remark'
  },
  {
    title: '县级城市名称',
    align: "center",
    dataIndex: 'city'
  },
  {
    title: '县级城市编码',
    align: "center",
    dataIndex: 'citycode'
  },
  {
    title: '市级城市名称',
    align: "center",
    dataIndex: 'pcity'
  },
  {
    title: '市级城市编码',
    align: "center",
    dataIndex: 'pcitycode'
  },
  {
    title: 'tenantId',
    align: "center",
    dataIndex: 'tenantId'
  },
  {
    title: '删除状态(0-正常,1-已删除)',
    align: "center",
    dataIndex: 'delFlag'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "类型：1-普通职位，2-灵活用工，3-共享用工",
    field: 'positionType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "position_type"
    },
    colProps: {span: 6},
  },
  {
    label: "是否兼职：1-兼职，0-全职",
    field: 'ifParttime',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "if_parttime"
    },
    colProps: {span: 6},
  },
  {
    label: "职位名称",
    field: 'postName',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '类型：1-普通职位，2-灵活用工，3-共享用工',
    field: 'positionType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "position_type"
    },
  },
  {
    label: '是否兼职：1-兼职，0-全职',
    field: 'ifParttime',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "if_parttime"
    },
  },
  {
    label: '公司ID',
    field: 'companyId',
    component: 'Input',
  },
  {
    label: '名称ID',
    field: 'postId',
    component: 'Input',
  },
  {
    label: '职位名称',
    field: 'postName',
    component: 'Input',
  },
  {
    label: '职位描述',
    field: 'descr',
    component: 'InputTextArea',
  },
  {
    label: '地址名称',
    field: 'addressName',
    component: 'Input',
  },
  {
    label: '门牌号',
    field: 'addressHouse',
    component: 'Input',
  },
  {
    label: '工作地点',
    field: 'address',
    component: 'Input',
  },
  {
    label: '地点经度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '地点纬度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '经验要求',
    field: 'expRequire',
    component: 'Input',
  },
  {
    label: '最低学历',
    field: 'minEducation',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "education"
    },
  },
  {
    label: '薪资范围',
    field: 'salaryLow',
    component: 'Input',
  },
  {
    label: '薪资范围',
    field: 'salaryUp',
    component: 'Input',
  },
  {
    label: '薪资月份',
    field: 'salaryMonth',
    component: 'InputNumber',
  },
  {
    label: '薪资范围',
    field: 'salary',
    component: 'Input',
  },
  {
    label: '薪资单位，兼职，元/时，元/天，元/周，元/月',
    field: 'unit',
    component: 'Input',
  },
  {
    label: '兼职，薪资单价',
    field: 'unitMoney',
    component: 'InputNumber',
  },
  {
    label: '奖金绩效',
    field: 'bonus',
    component: 'Input',
  },
  {
    label: '结算方式，兼职，日结、周结、月结、完工结',
    field: 'settlementType',
    component: 'InputNumber',
  },
  {
    label: '招聘人数',
    field: 'recruitsNumber',
    component: 'InputNumber',
  },
  {
    label: '兼职工作日',
    field: 'partDate',
    component: 'Input',
  },
  {
    label: '兼职时间',
    field: 'partTime',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '技能要求',
    field: 'skill',
    component: 'Input',
  },
  {
    label: '开始日期',
    field: 'startDate',
    component: 'DatePicker',
  },
  {
    label: '结束日期',
    field: 'endDate',
    component: 'DatePicker',
  },
  {
    label: '工作天数',
    field: 'workDays',
    component: 'InputNumber',
  },
  {
    label: '共享人数',
    field: 'shareNumber',
    component: 'InputNumber',
  },
  {
    label: '分享佣金',
    field: 'shareMoney',
    component: 'InputNumber',
  },
  {
    label: '浏览数量',
    field: 'browseNumber',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '县级城市名称',
    field: 'city',
    component: 'Input',
  },
  {
    label: '县级城市编码',
    field: 'citycode',
    component: 'Input',
  },
  {
    label: '市级城市名称',
    field: 'pcity',
    component: 'Input',
  },
  {
    label: '市级城市编码',
    field: 'pcitycode',
    component: 'Input',
  },
  {
    label: 'tenantId',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '删除状态(0-正常,1-已删除)',
    field: 'delFlag',
    component: 'InputNumber',
  },
  {
    label: '状态',
    field: 'status',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
